/*
 * Copyright (C) 2010 TopCoder Inc., All Rights Reserved.
 */
package com.hercules.xre.protocol.testing.handlers;

import java.awt.image.BufferedImage;

/**
 * This interface represents the contract of image comparer. It has single method: compare(...) to compare two images
 * (represented as {@link BufferedImage}). It is used by {@link ScreenshotEventHandler} to compare two screenshots.
 * <p>
 * <b>Thread safety:</b> Implementation is required to be thread safe.
 *
 * @author bramandia, 7realm
 * @version 1.0
 */
public interface ImageComparer {
    /**
     * Compare the given images.
     *
     * @param image1 the first image, must not be null
     * @param image2 the second image, must not be null
     * @return true if they are equal, false otherwise
     * @throws IllegalArgumentException if any argument is invalid
     * @throws ImageComparerException if there is any error during image compare
     */
    boolean compare(BufferedImage image1, BufferedImage image2) throws ImageComparerException;
}
